package org.ffsky.jsplugin;


import ohos.aafwk.ability.Ability;
import ohos.aafwk.content.Intent;

import java.util.List;


public final class JsPluginCompat {

    public static final void onPageFinished(List<JsPlugin> list) {
        for (JsPlugin plugin : list) {
            plugin.onPageFinished();
        }
    }

    public static final void create(List<JsPlugin> list, Ability activity, final ExposedJsApi exposedJsApi) {
        for (JsPlugin plugin : list) {
            plugin.setExposedJsApi(exposedJsApi);
            plugin.onCreate(activity);
        }
    }

    public static final void destroy(List<JsPlugin> list) {
        for (JsPlugin plugin : list) {
            plugin.onDestroy();
        }
    }

    public static final void onActivityResult(List<JsPlugin> list, int requestCode, int resultCode,  Intent data) {
        for (JsPlugin plugin : list) {
            plugin.onAbilityResult(requestCode, resultCode, data);
        }
    }
}
